// https://www.typescriptlang.org/docs/handbook/2/functions.html#optional-parameters-in-callbacks
// Typescript 对于传入的函数类型的多余参数会被忽略
// In JavaScript, if you call a function with more arguments than there are parameters, the extra arguments are simply ignored.
type CalcType = (num1: number, num2: number) => number

function calc(calcFn: CalcType) {
    calcFn(1, 2)
}

calc(function (num1, num2) {
    return 123
})

// forEach栗子：
const names = ["abc", "cba", "nba"]
names.forEach((item) => {
    console.log(item.length)
})

// TS对于很多类型的检测报不报错，取决于它的内部规则
// 举一个粒子
interface IPerson {
    name: string
    age: number
}

const p = {
    name: "why",
    age: 19,
    height: 19,
}

const info: IPerson = p

// {
//     name: "why",
//     age: 19,
// }

export {}